using System.Globalization;
using System.Text;
using System.Windows;
using System.Windows.Threading;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace FinanceSectionUtilities20250118
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            UpdateStatusBar();
            // 每秒更新一次状态栏时间
            DispatcherTimer timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Tick += (s, e) => UpdateStatusBar();
            timer.Start();
        }
        private void BudgetManagement_Click(object sender, RoutedEventArgs e)
        {
            // 打开预算管理窗口
            var wizard = new WizardWindow();
            wizard.Show();
        }
        private void Settings_Click(object sender, RoutedEventArgs e)
        {
            // 打开设置窗口
            MessageBox.Show("设置功能尚未实现");
        }
        private void Exit_Click(object sender, RoutedEventArgs e)
        {
            // 退出应用程序
            Application.Current.Shutdown();
        }
        private void UpdateStatusBar()
        {
            DateTime now = DateTime.Now;
            string weekOfYear = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(now, CalendarWeekRule.FirstDay, DayOfWeek.Monday).ToString();
            string statusText = $"{now:yyyy-MM-dd} 第{weekOfYear}周 {now:dddd} {now:HH:mm:ss}";
            StatusBarText.Text = statusText;
        }
    }
}